#include "asm/regdef.h"
#include "asm/asm.h"
#include "asm/context.h"
#include "inst_test.h"
#include "trap.h"
    .set noreorder
    .global main 
    .text 

main:
    ###test inst
    TEST_LBU(0x79dbf0ff, 0x80105498, 0x00001408, 0x00001408, 0x000000ff)
    TEST_LBU(0x9b5bab6c, 0x80104430, 0x0000252e, 0x0000252c, 0x0000005b)
    TEST_LBU(0xd156f470, 0x801045d8, 0x0000760b, 0x00007608, 0x000000d1)
    TEST_LBU(0x4d8564c0, 0x8010abac, 0x00005180, 0x00005180, 0x000000c0)
    TEST_LBU(0x927c9930, 0x8010ae00, 0x00004a28, 0x00004a28, 0x00000030)
    TEST_LBU(0x9ec5966a, 0x801072b8, 0x00001e9c, 0x00001e9c, 0x0000006a)
    TEST_LBU(0x13f91e58, 0x80101f30, 0x0000b600, 0x0000b600, 0x00000058)
    TEST_LBU(0x0249eebd, 0x80103d28, 0x00007e74, 0x00007e74, 0x000000bd)
    TEST_LBU(0x4d40dd0e, 0x80102c50, 0x0000c2d2, 0x0000c2d0, 0x00000040)
    TEST_LBU(0x1dd043a8, 0x80106a7c, 0x000030f8, 0x000030f8, 0x000000a8)
    TEST_LBU(0xed111118, 0x801042b4, 0x00002b60, 0x00002b60, 0x00000018)
    TEST_LBU(0x6937c000, 0x8010e7f0, 0x00000749, 0x00000748, 0x000000c0)
    TEST_LBU(0xe4f76a00, 0x8010a130, 0x00000768, 0x00000768, 0x00000000)
    TEST_LBU(0xee33dcd0, 0x8010bc2c, 0x00001868, 0x00001868, 0x000000d0)
    TEST_LBU(0xa6a67232, 0x80108b40, 0x00002f07, 0x00002f04, 0x000000a6)
    TEST_LBU(0x2c62e6d4, 0x80103cd4, 0x00000270, 0x00000270, 0x000000d4)
    TEST_LBU(0xdbe75a30, 0x80102854, 0x00000666, 0x00000664, 0x000000e7)
    TEST_LBU(0xd2201348, 0x80108b40, 0x00002bc1, 0x00002bc0, 0x00000013)
    TEST_LBU(0xbc509f3c, 0x80100910, 0x000081c3, 0x000081c0, 0x000000bc)
    TEST_LBU(0xd03bb99a, 0x80102a84, 0x00003780, 0x00003780, 0x0000009a)
    TEST_LBU(0xc1da3a60, 0x801091c0, 0x000054d0, 0x000054d0, 0x00000060)
    TEST_LBU(0x2c56dcf0, 0x80106094, 0x00004c86, 0x00004c84, 0x00000056)
    TEST_LBU(0xf4a53d22, 0x80100384, 0x00005326, 0x00005324, 0x000000a5)
    TEST_LBU(0x44b66444, 0x80109c48, 0x00003580, 0x00003580, 0x00000044)
    TEST_LBU(0x2982f7ac, 0x80100a18, 0x00001208, 0x00001208, 0x000000ac)
    TEST_LBU(0x90895498, 0x80106210, 0x0000759c, 0x0000759c, 0x00000098)
    TEST_LBU(0x71d04400, 0x80101d08, 0x00006faf, 0x00006fac, 0x00000071)
    TEST_LBU(0x244f2870, 0x80101f50, 0x0000a4c9, 0x0000a4c8, 0x00000028)
    TEST_LBU(0x60bdb8c0, 0x801060e0, 0x00009944, 0x00009944, 0x000000c0)
    TEST_LBU(0x952b094a, 0x80104a94, 0x00005700, 0x00005700, 0x0000004a)
    TEST_LBU(0x407a8b80, 0x8010bb68, 0x00003d78, 0x00003d78, 0x00000080)
    TEST_LBU(0x1ca93e6d, 0x80100c60, 0x00007e14, 0x00007e14, 0x0000006d)
    TEST_LBU(0xcbb35de0, 0x80102358, 0x000024e0, 0x000024e0, 0x000000e0)
    TEST_LBU(0x8bc60e3a, 0x80102aa0, 0x0000354a, 0x00003548, 0x000000c6)
    TEST_LBU(0x95020f1e, 0x80102008, 0x0000320d, 0x0000320c, 0x0000000f)
    TEST_LBU(0x4c6082f4, 0x801029e8, 0x000059ec, 0x000059ec, 0x000000f4)
    TEST_LBU(0xe8c29c44, 0x801041e4, 0x000030ca, 0x000030c8, 0x000000c2)
    TEST_LBU(0x7dd89185, 0x8010c0a8, 0x00003184, 0x00003184, 0x00000085)
    TEST_LBU(0xf2ef2428, 0x80104478, 0x0000b5bc, 0x0000b5bc, 0x00000028)
    TEST_LBU(0x2789e735, 0x80108088, 0x0000187c, 0x0000187c, 0x00000035)
    TEST_LBU(0x57613900, 0x80106434, 0x000080c8, 0x000080c8, 0x00000000)
    TEST_LBU(0xf831d258, 0x8010b5f0, 0x000012cc, 0x000012cc, 0x00000058)
    TEST_LBU(0x94768ba0, 0x80109ef8, 0x00003d84, 0x00003d84, 0x000000a0)
    TEST_LBU(0x6f5ab393, 0x801023d0, 0x000061b8, 0x000061b8, 0x00000093)
    TEST_LBU(0xd73483da, 0x80107a70, 0x00005009, 0x00005008, 0x00000083)
    TEST_LBU(0x4ab1c5a6, 0x80106ea8, 0x000061a0, 0x000061a0, 0x000000a6)
    TEST_LBU(0xd4b6c948, 0x80105864, 0x00006d0f, 0x00006d0c, 0x000000d4)
    TEST_LBU(0x1b189c1c, 0x80102564, 0x0000317e, 0x0000317c, 0x00000018)
    TEST_LBU(0x861b3d98, 0x80105df8, 0x000089a0, 0x000089a0, 0x00000098)
    TEST_LBU(0x1f876f58, 0x801010e0, 0x000046bc, 0x000046bc, 0x00000058)
    TEST_LBU(0x3b207858, 0x801014a4, 0x00001cf6, 0x00001cf4, 0x00000020)
    TEST_LBU(0x67c1dd18, 0x8010d370, 0x00002326, 0x00002324, 0x000000c1)
    TEST_LBU(0x706669a8, 0x801023dc, 0x00003fb0, 0x00003fb0, 0x000000a8)
    TEST_LBU(0x0e4383c0, 0x80110000, 0x000044a9, 0x000044a8, 0x00000083)
    TEST_LBU(0xd9c861cc, 0x80110000, 0x00005d3e, 0x00005d3c, 0x000000c8)
    TEST_LBU(0xfecf79cc, 0x80110000, 0x00006c20, 0x00006c20, 0x000000cc)
    TEST_LBU(0x62eab940, 0x80110000, 0x0000cfe1, 0x0000cfe0, 0x000000b9)
    TEST_LBU(0xc5f71c93, 0x80110000, 0x000003ac, 0x000003ac, 0x00000093)
    TEST_LBU(0xdc990bc0, 0x80110000, 0x00004632, 0x00004630, 0x00000099)
    TEST_LBU(0xffa821b0, 0x80110000, 0x0000047a, 0x00000478, 0x000000a8)
    TEST_LBU(0x669cb8f8, 0x80110000, 0x00005dc8, 0x00005dc8, 0x000000f8)
    TEST_LBU(0xd9650b98, 0x80110000, 0x0000d202, 0x0000d200, 0x00000065)
    TEST_LBU(0x845c79fc, 0x80110000, 0x0000f504, 0x0000f504, 0x000000fc)
    TEST_LBU(0xa7ed9420, 0x80110000, 0x0000e5e8, 0x0000e5e8, 0x00000020)
    TEST_LBU(0xa458f1f2, 0x80110000, 0x00009125, 0x00009124, 0x000000f1)
    TEST_LBU(0xad33ad20, 0x80110000, 0x0000db1a, 0x0000db18, 0x00000033)
    TEST_LBU(0xbd743318, 0x80110000, 0x0000c2f8, 0x0000c2f8, 0x00000018)
    TEST_LBU(0xec315702, 0x80110000, 0x00000230, 0x00000230, 0x00000002)
    TEST_LBU(0x7b433429, 0x80110000, 0x00000ae0, 0x00000ae0, 0x00000029)
    TEST_LBU(0x345592f0, 0x80110000, 0x0000d080, 0x0000d080, 0x000000f0)
    TEST_LBU(0x15fec970, 0x80110000, 0x0000a6d0, 0x0000a6d0, 0x00000070)
    TEST_LBU(0x483ec7ee, 0x80110000, 0x00008570, 0x00008570, 0x000000ee)
    TEST_LBU(0xca82fc00, 0x80110000, 0x00005cfe, 0x00005cfc, 0x00000082)
    TEST_LBU(0x25953f20, 0x80110000, 0x0000d0c3, 0x0000d0c0, 0x00000025)
    TEST_LBU(0xc7184dde, 0x80110000, 0x00005558, 0x00005558, 0x000000de)
    TEST_LBU(0x899be100, 0x80110000, 0x0000f0c4, 0x0000f0c4, 0x00000000)
    TEST_LBU(0x4629ad14, 0x80110000, 0x0000f550, 0x0000f550, 0x00000014)
    TEST_LBU(0xb741c3b2, 0x80110000, 0x00009370, 0x00009370, 0x000000b2)
    TEST_LBU(0x3b7a8198, 0x80110000, 0x00002dc5, 0x00002dc4, 0x00000081)
    TEST_LBU(0xc5e541f6, 0x80110000, 0x00003560, 0x00003560, 0x000000f6)
    TEST_LBU(0xdf5b1a0a, 0x80110000, 0x0000d8c0, 0x0000d8c0, 0x0000000a)
    TEST_LBU(0x9e06fab8, 0x80110000, 0x000004ca, 0x000004c8, 0x00000006)
    TEST_LBU(0x70df5f2c, 0x80110000, 0x0000b6ba, 0x0000b6b8, 0x000000df)
    TEST_LBU(0x5717a104, 0x80110000, 0x0000edc2, 0x0000edc0, 0x00000017)
    TEST_LBU(0x91f2f789, 0x80110000, 0x0000cf86, 0x0000cf84, 0x000000f2)
    TEST_LBU(0x48f3e380, 0x80110000, 0x00007b7c, 0x00007b7c, 0x00000080)
    TEST_LBU(0x804e0100, 0x80110000, 0x0000ce00, 0x0000ce00, 0x00000000)
    TEST_LBU(0x27635fe4, 0x80110000, 0x0000f2e0, 0x0000f2e0, 0x000000e4)
    TEST_LBU(0xffcbe970, 0x80110000, 0x000059ae, 0x000059ac, 0x000000cb)
    TEST_LBU(0x5a3cef6e, 0x80110000, 0x0000a605, 0x0000a604, 0x000000ef)
    TEST_LBU(0xef7b5e90, 0x80110000, 0x00008896, 0x00008894, 0x0000007b)
    TEST_LBU(0x262a5e90, 0x80110000, 0x0000f96f, 0x0000f96c, 0x00000026)
    TEST_LBU(0xa26701e8, 0x80110000, 0x00009399, 0x00009398, 0x00000001)
    TEST_LBU(0x2f2f73f0, 0x80110000, 0x0000ea14, 0x0000ea14, 0x000000f0)
    TEST_LBU(0x38ce4640, 0x80110000, 0x00005782, 0x00005780, 0x000000ce)
    TEST_LBU(0xbb69c800, 0x80110000, 0x00000b46, 0x00000b44, 0x00000069)
    TEST_LBU(0x7b9da800, 0x80110000, 0x0000f04a, 0x0000f048, 0x0000009d)
    TEST_LBU(0x5568c260, 0x80110000, 0x000072e0, 0x000072e0, 0x00000060)
    TEST_LBU(0x4bd93c80, 0x80110000, 0x0000ee30, 0x0000ee30, 0x00000080)
    TEST_LBU(0x23adf432, 0x80110000, 0x00006009, 0x00006008, 0x000000f4)
    TEST_LBU(0x6187f420, 0x80110000, 0x00002fd4, 0x00002fd4, 0x00000020)
    TEST_LBU(0x68363fa0, 0x80110000, 0x00003e68, 0x00003e68, 0x000000a0)
    TEST_LBU(0x3723c7f3, 0x80110000, 0x000043e0, 0x000043e0, 0x000000f3)
    TEST_LBU(0xd367e11a, 0x80110000, 0x00000000, 0x00000000, 0x0000001a)
    TEST_LBU(0xea1bc1e0, 0x80110000, 0x00000003, 0x00000000, 0x000000ea)
    TEST_LBU(0x0dbcd2ea, 0x80110000, 0x00000001, 0x00000000, 0x000000d2)
    TEST_LBU(0x2e8377c6, 0x80110000, 0x00000000, 0x00000000, 0x000000c6)
    TEST_LBU(0x85d1767c, 0x80110000, 0x00000001, 0x00000000, 0x00000076)
    TEST_LBU(0x2a807b6e, 0x80110000, 0x00000000, 0x00000000, 0x0000006e)
    TEST_LBU(0x7c7e468b, 0x80110000, 0x00000001, 0x00000000, 0x00000046)
    TEST_LBU(0x766b30aa, 0x80110000, 0x00000000, 0x00000000, 0x000000aa)
    TEST_LBU(0xf3112744, 0x80110000, 0x00000003, 0x00000000, 0x000000f3)
    TEST_LBU(0x24da377c, 0x80110000, 0x00000001, 0x00000000, 0x00000037)
    TEST_LBU(0x9eda1a30, 0x80110000, 0x00000001, 0x00000000, 0x0000001a)
    TEST_LBU(0x1e7730fe, 0x80110000, 0x00000000, 0x00000000, 0x000000fe)
    TEST_LBU(0x4acfdea0, 0x80110000, 0x00000001, 0x00000000, 0x000000de)
    TEST_LBU(0x84b70109, 0x80110000, 0x00000003, 0x00000000, 0x00000084)
    TEST_LBU(0xe4fb3fe0, 0x80110000, 0x00000002, 0x00000000, 0x000000fb)
    TEST_LBU(0x5a321c70, 0x80110000, 0x00000003, 0x00000000, 0x0000005a)
    TEST_LBU(0x2d4bafb8, 0x80110000, 0x00000000, 0x00000000, 0x000000b8)
    TEST_LBU(0x3b250b23, 0x80110000, 0x00000001, 0x00000000, 0x0000000b)
    TEST_LBU(0x5f9c75e8, 0x80110000, 0x00000000, 0x00000000, 0x000000e8)
    TEST_LBU(0xc37b66a0, 0x80110000, 0x00000002, 0x00000000, 0x0000007b)
    TEST_LBU(0x9beb24a0, 0x80110000, 0x00000000, 0x00000000, 0x000000a0)
    TEST_LBU(0x10fdc3f6, 0x80110000, 0x00000003, 0x00000000, 0x00000010)
    TEST_LBU(0x58cf1c72, 0x80110000, 0x00000002, 0x00000000, 0x000000cf)
    TEST_LBU(0x01e4337c, 0x80110000, 0x00000002, 0x00000000, 0x000000e4)
    TEST_LBU(0xcadca1a0, 0x80110000, 0x00000001, 0x00000000, 0x000000a1)
    TEST_LBU(0xe439bcca, 0x80110000, 0x00000002, 0x00000000, 0x00000039)
    TEST_LBU(0xcac58484, 0x80110000, 0x00000002, 0x00000000, 0x000000c5)
    TEST_LBU(0xd6fd5b64, 0x80110000, 0x00000000, 0x00000000, 0x00000064)
    TEST_LBU(0x0b3279d8, 0x80110000, 0x00000003, 0x00000000, 0x0000000b)
    TEST_LBU(0x63074a44, 0x80110000, 0x00000001, 0x00000000, 0x0000004a)
    TEST_LBU(0xd84c8078, 0x80110000, 0x00000003, 0x00000000, 0x000000d8)
    TEST_LBU(0xf9e9931a, 0x80110000, 0x00000003, 0x00000000, 0x000000f9)
    TEST_LBU(0x1e1d11d0, 0x80110000, 0x00000003, 0x00000000, 0x0000001e)
    TEST_LBU(0xd4be0052, 0x80110000, 0x00000003, 0x00000000, 0x000000d4)
    TEST_LBU(0xc1d5e430, 0x80110000, 0x00000001, 0x00000000, 0x000000e4)
    TEST_LBU(0xf4fd59b0, 0x80110000, 0x00000000, 0x00000000, 0x000000b0)
    TEST_LBU(0xdd4f3800, 0x80110000, 0x00000002, 0x00000000, 0x0000004f)
    TEST_LBU(0x9b0f1ecc, 0x80110000, 0x00000003, 0x00000000, 0x0000009b)
    TEST_LBU(0xb3f10774, 0x80110000, 0x00000001, 0x00000000, 0x00000007)
    TEST_LBU(0x87ec25fc, 0x80110000, 0x00000001, 0x00000000, 0x00000025)
    TEST_LBU(0x07e1f300, 0x80110000, 0x00000000, 0x00000000, 0x00000000)
    TEST_LBU(0x933cb3e0, 0x80110000, 0x00000003, 0x00000000, 0x00000093)
    TEST_LBU(0xace9f794, 0x80110000, 0x00000000, 0x00000000, 0x00000094)
    TEST_LBU(0x60a3b6d8, 0x80110000, 0x00000001, 0x00000000, 0x000000b6)
    TEST_LBU(0x954eb5ee, 0x80110000, 0x00000001, 0x00000000, 0x000000b5)
    TEST_LBU(0x95ffcf80, 0x80110000, 0x00000003, 0x00000000, 0x00000095)
    TEST_LBU(0xe20efe40, 0x80110000, 0x00000000, 0x00000000, 0x00000040)
    TEST_LBU(0x826e0c40, 0x80110000, 0x00000003, 0x00000000, 0x00000082)
    TEST_LBU(0x3c7f3796, 0x80110000, 0x00000003, 0x00000000, 0x0000003c)
    TEST_LBU(0xd82d4498, 0x80110000, 0x00000002, 0x00000000, 0x0000002d)
    TEST_LBU(0x00000000, 0x80110000, 0x00000000, 0x00000000, 0x00000000)
    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP